Skip to content

chore: camel-jbang - Add SQL query dev-console, TUI tab with inline editing, and MCP tools#24281

Open
davsclaus wants to merge 9 commits into
mainfrom
sql-query-tui
Open

chore: camel-jbang - Add SQL query dev-console, TUI tab with inline editing, and MCP tools#24281
davsclaus wants to merge 9 commits into
mainfrom
sql-query-tui

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Summary

  • Add sql-query dev-console for executing SQL queries and row updates against DataSource beans via JDBC
  • Add camel sql CLI command for querying databases from the terminal
  • Add SQL Query TUI tab with multi-line input, query history (Ctrl+E), datasource switching, and result table
  • Add inline row editing: press Enter on a result row to open an edit form, change values, F5 to auto-generate and execute an UPDATE statement (single-table queries only, with PK detection via JDBC metadata)
  • Add tui_execute_sql, tui_update_row MCP tools for AI agents
  • Enrich tui_get_table MCP response with SQL input state, datasource, selected row, and editability metadata

Test plan

  • Run a Camel app with a DataSource (e.g. the built-in sql example)
  • Open TUI, navigate to SQL Query tab, execute SELECT * FROM table
  • Verify results display with row count and elapsed time
  • Tab to results, press Enter on a row — edit form opens
  • Change a value, press F5 — UPDATE executes, table refreshes
  • Verify PK columns are read-only (marked with *)
  • Verify complex queries (JOINs) don't show Edit option
  • Verify Ctrl+E opens query history
  • Verify number keys don't switch tabs during edit mode
  • Test MCP tools: tui_execute_sql, tui_update_row, tui_get_table

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

davsclaus and others added 3 commits June 28, 2026 10:56
… and MCP tool

Adds end-to-end SQL query support: a new sql-query dev-console that
executes queries against DataSource beans, a `camel cmd sql` CLI command,
a TUI SQL Query tab with query history (reusable InputHistory class),
and a tui_execute_sql MCP tool for AI agents.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Add the ability to edit result rows directly in the TUI SQL query tab.
Press Enter on a result row to open an edit form, change values, and
press F5 to auto-generate and execute an UPDATE statement. Includes
single-table detection via JDBC metadata, primary key discovery,
PreparedStatement-based updates with proper type coercion, and an
MCP tui_update_row tool for AI agents.

Also fixes: ResultSet conflict crash (PK lookup moved after row
iteration), number keys switching tabs during edit mode, and
integer column type handling in updates.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Include current SQL text, datasource name, selected row index, primary
keys, and executing flag in the tui_get_table JSON response for the
SQL Query tab, so AI agents have full context about the query state.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • core/camel-console
  • docs
  • dsl/camel-cli-connector
  • dsl/camel-jbang/camel-jbang-core
  • dsl/camel-jbang/camel-jbang-plugin-tui

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 1 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (15 modules)
  • Camel :: All Core Sync point
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Console
  • Camel :: DSL :: CLI Connector
  • Camel :: DSL :: CLI Debug
  • Camel :: Diagram
  • Camel :: JBang :: Console
  • Camel :: JBang :: Core
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

davsclaus and others added 5 commits June 28, 2026 20:45
Use shared hint() helper in SQL tab footer instead of custom dimmed
styles. Reorder insertFKeyHints to put F1-F3 at front and F6 at end
so tab-specific F-keys (e.g. F5) appear in numeric order.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Type file:query.sql in the input field and press F5 to load and
execute SQL from a file. The file content replaces the input text
before execution.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…eries

Move file: resolution from CLI/TUI to LocalCliConnector, consistent
with how send message handles file: loading. The CLI and TUI pass
file:path as-is and the connector reads the file on the running app.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant